home *** CD-ROM | disk | FTP | other *** search
/ AOL File Library: 2,801 to 2,900 / aol-file-protocol-4400-2801-to-2900.zip / AOLDLs / C++ Files Library / SK (Sockects) 1.4.1 r2 / SK v1.4.1 r2.sit / SK 1.4.1 r2 / SK / TCP Headers / MiscIPPB.h < prev    next >
Text File  |  1993-06-15  |  3KB  |  112 lines

  1. /* 
  2.     IPPB.h    
  3.     C definitions of parameter block entries needed for IP calls
  4.  
  5.     Copyright Apple Computer, Inc. 1988-91 
  6.     All rights reserved
  7.     
  8. */
  9. #ifndef __MISCIPPB__
  10. #define __MISCIPPB__
  11.  
  12. #ifndef __MACTCPCOMMONTYPES__
  13. #include <MacTCPCommonTypes.h>
  14. #endif
  15.  
  16. #ifndef __APPLETALK__
  17. #include <AppleTalk.h>
  18. #endif
  19.  
  20. /* control codes */
  21. #define ipctlEchoICMP        17            /* send icmp echo */
  22. #define ipctlLAPStats        19            /* get lap stats */
  23.  
  24. #define IPParamBlockHeader     \
  25.     struct QElem *qLink;     \
  26.     short qType;             \
  27.     short ioTrap;             \
  28.     Ptr ioCmdAddr;             \
  29.     ProcPtr ioCompletion;     \
  30.     OSErr ioResult;         \
  31.     StringPtr ioNamePtr;     \
  32.     short ioVRefNum;        \
  33.     short ioCRefNum;        \
  34.     short csCode
  35.     
  36. typedef void (*ICMPEchoNotifyProc) (struct ICMPParamBlock *iopb);
  37.  
  38.  
  39. struct IPParamBlock {
  40.     IPParamBlockHeader;                    /* standard I/O header */
  41.     union {
  42.         struct {
  43.             ip_addr    dest;                /* echo to IP address */
  44.             wdsEntry data;
  45.             short timeout;
  46.             Ptr options;
  47.             unsigned short optLength;
  48.             ICMPEchoNotifyProc icmpCompletion;
  49.             unsigned long userDataPtr;
  50.             } IPEchoPB;
  51.         struct {
  52.             struct LAPStats *lapStatsPtr;
  53.             } LAPStatsPB;
  54.         } csParam;
  55.     };
  56.  
  57. struct ICMPParamBlock {
  58.     IPParamBlockHeader;                    /* standard I/O header */
  59.     short params[11];
  60.     struct {
  61.         unsigned long echoRequestOut;    /* time in ticks of when the echo request went out */
  62.         unsigned long echoReplyIn;        /* time in ticks of when the reply was received */
  63.         struct rdsEntry echoedData;        /* data received in responce */
  64.         Ptr options;
  65.         unsigned long userDataPtr;
  66.         } icmpEchoInfo;
  67.     };
  68.  
  69.     
  70. typedef struct LAPStats {
  71.     short    ifType;
  72.     char    *ifString;
  73.     short    ifMaxMTU;
  74.     long    ifSpeed;
  75.     short    ifPhyAddrLength;
  76.     char    *ifPhysicalAddress;
  77.     union {
  78.         struct arp_entry *arp_table;    
  79.         struct nbp_entry *nbp_table;
  80.         } AddrXlation;
  81.     short    slotNumber;
  82.     };
  83.     
  84. #define NBP_TABLE_SIZE    20                /* number of NBP table entries */
  85. #define NBP_MAX_NAME_SIZE    16+10+2
  86.  
  87. struct nbp_entry {
  88.     ip_addr     ip_address;                /* IP address */
  89.     AddrBlock    at_address;                /* matching AppleTalk address */
  90.     Boolean        gateway;                /* TRUE if entry for a gateway */
  91.     Boolean        valid;                    /* TRUE if LAP address is valid */
  92.     Boolean        probing;                /* TRUE if NBP lookup pending */
  93.     long        age;                    /* ticks since cache entry verified */
  94.     long        access;                    /* ticks since last access */
  95.     char        filler[116];            /* for internal use only !!! */
  96.     };
  97.  
  98. #define ARP_TABLE_SIZE    20                /* number of ARP table entries */
  99.  
  100. typedef struct Enet_addr {
  101.     b_16 en_hi;
  102.     b_32 en_lo;
  103.     } Enet_addr;
  104.  
  105. typedef struct arp_entry {
  106.     short        age;            /* cache aging field */
  107.     b_16        protocol;        /* Protocol type */
  108.     ip_addr     ip_address;        /* IP address */
  109.     Enet_addr    en_address;        /* matching Ethernet address */
  110.     };
  111.  
  112. #endif